<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeFile="EditArticle.aspx.cs" Inherits="Impact.Web.Admin.EditArticle" ValidateRequest="false" EnableEventValidation="false"  %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <script type="text/javascript">
        function tagClick(tagId, controlName)
        {
            var arguments = tagId +","+ controlName;
            <%= TagClickScript %>
        }
        
        function tagClickResult(arguments)
        {
            var args = arguments.split(",");        
            var tag = document.getElementById(args[0]);
            var enabled = eval(args[1]);
            if(enabled) tag.className = "TagSelected";
            else tag.className = "TagUnselected";
        }
    </script>

    <asp:HiddenField ID="_articleId" runat="server" />
    <asp:HiddenField ID="_enabled" runat="server" />

    <table class="AdminTable">
    
        <tr>
            <th colspan="3">Edit Article</th>
        </tr>
        
        <tr>
            <td>Title:</td>
            <td><asp:TextBox ID="_title" runat="server" /></td>
            <td><asp:RequiredFieldValidator ID="titleRequired" ControlToValidate="_title" SetFocusOnError="true" ErrorMessage="Please enter an article title" runat="server" /></td>
        </tr>
        
        <tr>
            <td>Category:</td>
            <td><asp:DropDownList ID="_category" runat="server"></asp:DropDownList></td>
        </tr>
        
        <tr>
            <td colspan="3">
                <FCKeditor:FCKeditor ID="_body" BasePath="../FCKeditor/" SkinPath="skins/office2003/" Height="400px" runat="server" />
            </td>
        </tr>
        
        <tr>
            <td rowspan="3" style="vertical-align: top;">Tags:</td>
            <td>
                <asp:Repeater ID="tags" OnItemDataBound="TagBinding" runat="server">
                    <ItemTemplate>
                        <asp:HyperLink ID="tagLink" runat="server"><%# Eval("Text") %></asp:HyperLink>
                    </ItemTemplate>
                </asp:Repeater>
            </td>
        </tr>
        
        <tr>
            <td><asp:CustomValidator ID="newTagsValidator" ControlToValidate="newTags" OnServerValidate="ValidateTags"
                    ErrorMessage="You have entered invalid tags.  Please choose new tags." SetFocusOnError="true" Display="dynamic" runat="server" /></td>
        </tr>
        <tr>
            <td style="font-size: 0.7em;">
                New Tags: &nbsp;&nbsp;<asp:TextBox ID="newTags" Font-Size="1.0em" runat="server" />&nbsp;&nbsp; (separate with commas)
            </td>
        </tr>
        
        <tr>
            <td colspan="3" style="text-align: center;">
                <impact:SubmitCancel id="submit" OnSubmit="SubmitCommand" OnCancel="CancelCommand" runat="server" />                
            </td>
        </tr>
    
    </table>


</asp:Content>
